Skip to content

Align MC timeframes using FirstOrbitMC from MCProdInfo - #16154

Open
sawenzel wants to merge 1 commit into
AliceO2Group:devfrom
sawenzel:o2-7335-firstorbitmc
Open

sawenzel wants to merge 1 commit into
AliceO2Group:devfrom
sawenzel:o2-7335-firstorbitmc

Conversation

@sawenzel

@sawenzel sawenzel commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

This replaces the hardcoded list of MC productions in AggregatedRunInfo::adjust_from_MC by a per-run value from CCDB.

The SOR correction for MC anchored with a ramp-up shift that is not a multiple of the TF length depends on the run, not on the production: on the TF length, on the ITS ramp-up at the anchor time, and on the O2DPG version that anchored it. The MCProdInfo object of each run now carries FirstOrbitMC, the first orbit the MC actually used, and the shift is computed as (FirstOrbitMC - orbitSOR) mod orbitsPerTF. Without the key, no correction is applied.

The key has already been published for all 2210 runs with MC data of the productions in the list (EP26d1 is an event-pool production that is not analysed and has no MCProdInfo, so it needs none), read from the runs' own GRID job logs and cross-checked by rerunning the anchoring. For 78 of these runs the list on dev still applies a wrong shift:

Production Runs Software Orbits/TF Needed List
LHC26c12 74 v14 6, 16, 32 0 2 or 4
LHC26c12 1 v14 128 64 36
LHC26h3 3 v14 16, 32 0 4

To fix a production in the future, use MC/prodinfo/mcprodinfo_firstorbit.py from O2DPG (recipe in the commit message). Publishing needs the aliprod role, so please open an O2 JIRA ticket and ask me.

Relates to https://its.cern.ch/jira/browse/O2-7335 and AliceO2Group/O2DPG#2558

Assisted by Claude Code.

@sawenzel

Copy link
Copy Markdown
Collaborator Author

@altsybee : Please review this proposed change.

@sawenzel
sawenzel force-pushed the o2-7335-firstorbitmc branch from cf90493 to 035247f Compare November 18, 2026 17:42
This replaces the hardcoded list of MC productions in AggregatedRunInfo::adjust_from_MC by a per-run value from CCDB.

- The correction now uses the key FirstOrbitMC of the MCProdInfo object of each run.
- The shift is (FirstOrbitMC - orbitSOR) mod orbitsPerTF, so it holds for any TF length, anchor time and software version.
- Without the key, no correction is applied.
- The shift is computed by AggregatedRunInfo::tfAlignmentShift, covered by a unit test; an invalid orbitsPerTF disables it.
- MCProdInfo is read without a not-after limit, so corrections published later stay visible.
- New productions record FirstOrbitMC themselves (O2DPG). Existing ones are fixed with O2DPG's MC/prodinfo/mcprodinfo_firstorbit.py.
- Publishing needs the aliprod role. If a production needs fixing, please open an O2 JIRA ticket and ask Sandro Wenzel.

Recipe to fix a production:

    mcprodinfo_firstorbit.py scan --tag <TAG> -o <TAG>.json
    mcprodinfo_firstorbit.py rerun <TAG>.json --crosscheck 3
    mcprodinfo_firstorbit.py apply <TAG>.json --comment "FirstOrbitMC added because of O2-XXXX" --yes

scan reads the first orbit of each run from its GRID job logs, rerun fills runs without logs and cross-checks a sample (needs CVMFS), apply publishes (dry run without --yes).

https://its.cern.ch/jira/browse/O2-7335

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sawenzel
sawenzel force-pushed the o2-7335-firstorbitmc branch from 035247f to aeaece1 Compare November 18, 2026 17:52

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant